import Cookies from 'js-cookie'

const TOKEN = 'hrsaas-token'
const TOKEN_TIME = 'token-time'
//存
export function getToken() {
  return Cookies.get(TOKEN)
}
//取
export function setToken(data) {
  return Cookies.set(TOKEN,data)
}
//删
export function removeToken() {
  return Cookies.remove(TOKEN)
}
//存token时间戳
export function getTimestamp() {
  return Cookies.get(TOKEN_TIME)
}
//取
export function setTimestamp(data) {
  const time = Date.now()
  return Cookies.set(TOKEN_TIME,time)
}
//删
export function removeTimestamp() {
  return Cookies.remove(TOKEN_TIME)
}